import { request } from '@boeyo/portal';

/**
 * 监测列表树形列表
 * null
 */
export const tree = (data) => {
  return request({
    url: '/monitoring/tree',
    method: 'POST',
    data,
  });
};

/**
 * 关联监测结构的设备列表
 * null
 */
export const deviceList = (params) => {
  return request({
    url: '/monitoring/deviceList',
    method: 'GET',
    params,
  });
};

/**
 * 设备运行统计
 * null
 */
export const run = (data) => {
  return request({
    url: 'deviceData/run',
    method: 'POST',
    data,
  });
};

/**
 * 按月设备运行统计
 * null
 */
export const runMonth = (params) => {
  return request({
    url: 'deviceData/runMonth',
    method: 'get',
    params,
  });
};

/**
 * 当日延迟折线图
 * null
 */
export const dayDelay = (data) => {
  return request({
    url: 'deviceData/dayDelay',
    method: 'POST',
    data,
  });
};
/**
 * 三十天延迟统计
 * null
 */
export const delayStatistics = (data) => {
  return request({
    url: 'deviceData/delayStatistics',
    method: 'POST',
    data,
  });
};

/**
 * 三十天告警统计
 * null
 */
export const errorStatistics = (data) => {
  return request({
    url: 'deviceData/errorStatistics',
    method: 'POST',
    data,
  });
};

/**
 * 每日告警详情
 * null
 */
export const deviceError = (params) => {
  return request({
    url: 'deviceData/deviceError',
    method: 'get',
    params,
  });
};
